package mars.ns

import mars.ns.core._
import scala.actors._
import mars.ns.selectors.NodeSelection
import mars.ns.statechangers.StateChange


class RoundSimulation[T <: Node](network: Network[T],isEnded: Int => Boolean) 
		extends Simulation(network, isEnded) with NodeSelection[T] with StateChange[T] {

    /**
     * Constructor giving a network and an amount of iterations that the simulation may run
     */
    def this(network : Network[T],iterations : Int) =
      this(network, Simulation.toMaxIterationFunction(iterations) )

	override def nextIteration {
        val nodeList = network.getNodes
        nodeList.foreach(argNode => {checkStateChange(argNode, RoundSimulation.this)})
    }
}